package com.zut.tx;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
@Repository("userDao")
public class UserDaoImpl implements UserDao {
    @Resource
	private JdbcTemplate jdbcTemplate;
	public void Transfer() {
		String sql1="update user set money=money-123 where id=1";
		String sql2="update user set money=money+123 where id=2";
		
		jdbcTemplate.update(sql1);
		//int i = 1/0;
		jdbcTemplate.update(sql2);
	}

}
